/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"8EB7D15B-5373-4CC7-B3D4-D9ED640B1045",variableType:4}
 */
var gUsrID = null;

/**
 * Callback method for when solution is opened.
 *
 * @properties={typeid:24,uuid:"D933CC98-6E69-4FBD-BEDD-2EAB87306FFB"}
 */
function filtroUserv() {
	databaseManager.addTableFilterParam('fwk_navigation_infocom',null,'userv_id','=',globals.gUsrID,'USERV')
}

/**
 *
 * @properties={typeid:24,uuid:"9EC5F0A9-A588-4AF8-B32B-786B656926B0"}
 */
function autoSaveOff() {
	databaseManager.setAutoSave(false)
}

/**
 *
 * @properties={typeid:24,uuid:"0D5AAB8A-CF92-4507-9923-3804E80F29A3"}
 */
function hashPass(p) {
	return utils.stringMD5HashBase64(p)	
}

/**
 * @properties={typeid:24,uuid:"198C8F4D-03BC-4C21-BE17-3355F598F59C"}
 */
function agregarUserv()
{
	security.createGroup('USERVS')
	var a = security.createUser( 'Logistica Centro',  'logi')
	security.addUserToGroup(a, 'USERVS')
}

/**
 * @properties={typeid:24,uuid:"500E89A5-8BEA-469A-9D76-DE87674AADF0"}
 */
function salir() {
	security.logout()
	application.exit()
}

/**
 * Callback method for when solution is opened.
 *
 * @properties={typeid:24,uuid:"3745229E-CFE9-4283-9DFB-7AE9286C6417"}
 * @AllowToRunInFind
 */
function onSolutionOpen() {
	/**@type {JSFoundSet<db:/fwk_navigation_infocom/uservs>} */
	var fs = databaseManager.getFoundSet('fwk_navigation_infocom','uservs')
	fs.find()
	fs.login_nombre = security.getUserName()
	var $cant = fs.search()
	if ($cant == 1)
	{
		globals.gUsrID = fs.userv_id
	}
}
